//
//  WmcAccountModel.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/3/29.
//

import Foundation

// MARK: - [WmcAccountModel]

struct WmcAccountModel: YPNetworkJsonProtocol {
    /// 姓名
    var name: String = ""

    /// 头像
    var avatar: String = ""

    /// 是否是新用户
    var isNew: Bool = false

    /// 是否设置过密码
    var hasPassword: Bool = false

    /// 水印相机 token
    var token: String = ""

    /// 用户id
    var memberId: Int = 0

    /// 鱼泡网id
    var yupaoId: Int = 0

    /// 手机号
    var phone: String = ""

    /// 来源
    var source: String = ""

    /// 版本
    var version: String = ""

    /// 创建时间
    var createTime: TimeInterval = 0

    /// 最后登录时间
    var lastLoginTime: TimeInterval = 0

    /// 删除时间
    var deleteTime: TimeInterval = 0
    
    var userId: String = ""
    
    /// 团队id
    var teamId: String = ""

    mutating func mapping(mapper: HelpingMapper) {
        mapper <<< self.isNew <-- ["is_new", "isNew"]
        mapper <<< self.hasPassword <-- ["has_passwd", "hasPass"]
        mapper <<< self.memberId <-- ["member_id", "memberId"]
        mapper <<< self.yupaoId <-- ["yupao_id", "yupaoId"]
        mapper <<< self.createTime <-- "create_time"
        mapper <<< self.lastLoginTime <-- ["last_login_time", "lastLoginTime"]
        mapper <<< self.deleteTime <-- "delete_time"
        mapper <<< self.token <-- ["wmctoken", "wmcToken"]
    }
}

// MARK: - [WmcYupaoAccountModel]

public struct WmcYupaoAccountModel: YPNetworkJsonProtocol {
    // Lifecycle

    public init() {}

    // Public

    /// 用户id
    public var userId: String = ""

    /// 一键登录token
    public var singleSignToken: String = ""

    /// token
    public var token: String = ""

    /// 是否是新用户
    public var isNewMember: String = ""

    /// 昵称
    public var nickname: String = ""

    /// 手机号
    public var phone: String = ""

    /// 用户类型
    public var userType: String = ""

    /// 用户名
    public var username: String = ""

    public var isOpen: String = ""

    public var isResume: String = ""

    public var uuid: String = ""

    public var errcode: String?

    public mutating func mapping(mapper: HelpingMapper) {
        mapper <<< self.singleSignToken <-- "singletoken"
        mapper <<< self.username <-- "userName"
        mapper <<< self.nickname <-- "nickName"
    }
}
